import request from '../utils/request';

export const fetchData = () => {
    return request({
        url: './mock/table.json',
        method: 'get'
    });
};

export const fetchUserData = () => {
    return request({
        url: './mock/user.json',
        method: 'get'
    });
};

export const fetchRoleData = () => {
    return request({
        url: './mock/role.json',
        method: 'get'
    });
};

/**
 * 获取事故分布
 * @returns 
 */
export const getAccidents = () => {
    return request({
        url: '/api/accidents/city?city=北京市',
        method: 'get'
    });
};

export const getAreaAccidents = (district: string) => {
    return request({
        url: '/api/accidents/district?district='+district,
        method: 'get'
    });
};

export const getAccidentGraph = (accidentId: string) => {
    return request({
        url: '/api/accidents/graph?accident_id='+accidentId,
        method: 'get'
    });
};
